﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SiteMaster.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="Server">

    <div id="content_left">
        <asp:Repeater ID="repCars" runat="server" ItemType="DL.Car" OnItemCommand="lnkDetails_Click">
            <ItemTemplate>
                <div class="post_section">
                    <table style="width:779px">
                        <tr>
                            <input type="hidden" value="<%# Eval("CarID") %>" id="hd" />
                            <td style="width:135px">
                                <img src="<%# Eval("DefaultImage") %>" alt="image 1" width="136" height="98" /></td>
                            <td style="width:520px">

                                <div class="headerPost">
                                    <asp:LinkButton runat="server" ID="lnkDetails" CommandName="Edit" CommandArgument='<%# Eval("CarID") %>'><%# Eval("Model.Name") %></asp:LinkButton>
                                </div>
                                <div id="postDesc">
                                    <div id="desc"><a><%# Eval("Condition") %></a></div>
                                    <div id="otherfunctions">
                                        <div id="ck-button">
                                            <label>
                                                <asp:CheckBox runat="server" Checked='<%#Convert.ToBoolean(Eval("IsFav")) %>' />
                                                <span onclick="func(<%#Eval("CarID") %>)"></span>
                                            </label>
                                        </div>
                                        <div class="addtime" style="display: block"><%# Eval("CreateDate") %></div>
                                        <asp:LinkButton class="delete" runat="server" ID="lnkDelete" CommandName="Delete" CommandArgument='<%# Eval("CarID") %>'></asp:LinkButton>
                                    </div>
                                </div>
                            </td>
                            <td class="pricerow"><%# Eval("Price") %><div id="total">total value</div>
                            </td>
                            <td class="checkboxtd">
                                <div>
                                    <div class="squaredFour">
                                        <input type="checkbox" value="None" id="squaredFour1" name="check" />
                                        <label for="squaredFour1"></label>
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </ItemTemplate>
        </asp:Repeater>
    </div>
    <script src="js/jquery-1.8.2.min.js"></script>

    <div id="archivehide" onclick="location.href='#.html';">
        <a href="#">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ნახე დაარქივებულები</a>
    </div>

    <%--დაარქივებულის ნახვა--%>
    <div id="hiddenarchivelist">

        <asp:Repeater ID="repArchived" runat="server" ItemType="DL.Car" OnItemCommand="lnkDetails_Click">
            <ItemTemplate>
                <div class="post_section">
                    <table style="width:779px">
                        <tr>
                            <input type="hidden" value="<%# Eval("CarID") %>" id="hd" />
                            <td style="width:135px">
                                <img src="<%# Eval("DefaultImage") %>" alt="image 1" width="136" height="98" /></td>
                            <td style="width:520px">

                                <div class="headerPost">
                                    <asp:LinkButton runat="server" ID="lnkDetails" CommandName="Edit" CommandArgument='<%# Eval("CarID") %>'><%# Eval("Model.Name") %></asp:LinkButton>
                                </div>
                                <div id="postDesc">
                                    <div id="desc"><a><%# Eval("Condition") %></a></div>
                                    <div id="otherfunctions">
                                        <div id="ck-button">
                                            <label>
                                                <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%#Convert.ToBoolean(Eval("IsFav")) %>' />
                                                <span onclick="func(<%#Eval("CarID") %>)"></span>
                                            </label>
                                        </div>
                                        <div class="addtime" style="display: block"><%# Eval("CreateDate") %></div>
                                        <asp:LinkButton class="deleted" runat="server" ID="lnkDelete" CommandName="Delete" CommandArgument='<%# Eval("CarID") %>'></asp:LinkButton>
                                    </div>
                                </div>
                            </td>
                            <td class="pricerow"><%# Eval("Price") %><div id="total">total value</div>
                            </td>
                            <td class="checkboxtd">
                                <div>
                                    <div class="squaredFour">
                                        <input type="checkbox" value="None" id="squaredFour1" name="check" />
                                        <label for="squaredFour1"></label>
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </ItemTemplate>
        </asp:Repeater>
    </div>

    <footer>
        <div class="container1">
            <script>
                $(".activeLi").click(function () {
                    $("#hidedform").fadeToggle("slow");
                });
                function func(value) {
                    $.ajax({
                        type: "POST",
                        url: '<%= ResolveUrl("WebService.asmx/AddFav") %>',
                        data: "{'carID':'" + value + "' }",
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        success: function () { }
                    });
                }

                function AddTrashed(value) {
                    $.ajax({
                        type: "POST",
                        url: '<%= ResolveUrl("WebService.asmx/AddTrashed") %>',
                        data: "{'carID':'" + value + "' }",
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        success: function () { }
                    });
                }

               
            </script>
        </div>
    </footer>
</asp:Content>

